<script setup name="OADialog">

const dialogFormVisible = defineModel({required:true})
const emits = defineEmits(['cancel','submit'])


const props = defineProps({
    title:"",
    width:{
        type:String,
        default:'60%'
    }
})

const onCancel = () => {
    dialogFormVisible.value = false
    emits('cancel')
}

const onSubmit = () => {
    emits('submit')
}

</script>

<template>
    <el-dialog v-model="dialogFormVisible" :title="props.title" :width="props.width">
        <slot></slot>
        <template #footer>
            <span class="dialog-footer">
                <el-button @click="onCancel">取消</el-button>
                <el-button type="primary" @click="onSubmit">
                    确认
                </el-button>
            </span>
        </template>
    </el-dialog>
</template>

<style scoped></style>